<template>
  <mt-popup
    v-model="visible"
    :closeOnClickModal="false"
    class="prompting-layer">
    <div class="promptingTop">
      <img src="../views/login/img/Notice_icon@2x.png" />
      <p v-if="lookMessage.role==0">登录后可继续观看直播</p>
      <p v-if="lookMessage.role==1">当前仅开放<span>正式熙隆VIP</span>用户观看<br/>请前往<span>PC端开通</span></p>
      <p v-if="lookMessage.role==2">当前仅开放<span>代理</span>观看<br/>请前往<span>PC端申请</span></p>
      <router-link :to="'/login/sign-in?redirect='+location" v-if="lookMessage.is_login==false" class="btn_left" >登录</router-link>
      <router-link :to="'/login/sign-up?redirect='+location" v-if="lookMessage.is_login==false&&lookMessage.role==0" class="btn_right" >注册</router-link>
    </div>
    <div class="promptingBottom" v-if="!lookMessage.password">
      <a>客服QQ：3143329170</a>
    </div>
    <div class="promptingBottom1" v-if="lookMessage.password">
      <p class="title">或使用以下方式进入</p>
      <div><input type="password" v-model="Password" placeholder="请输入密码" /><p class="promptingBtn" @click="passwordBtn">进入</p></div>
      <div class="promptingA">
        <a>客服QQ：3143329170</a>
      </div>
    </div>
  </mt-popup>
</template>
<script>
  import { Popup } from 'mint-ui'
  export default {
    data () {
      return {
        visible: false,
        Password: '',
        location: window.location.href
      }
    },
    props: ['lookMessage'],
    methods: {
      close () {
        this.other = ''
        this.price = 0
      },
      passwordBtn () {
        if(this.Password=='') {
           return this.$message.error('密码不能为空');
        }
        this.$http.post('/index/purview/password',{password: this.Password})
          .then((res) => {
          let data = JSON.parse(res)
            if (data.type) {
              if (data.status == 2) {
                this.$emit('fromChildMsg');
                this.visible = false;
                window.location.reload();
              }else if (data.status == 3) {
                this.$message.error(data.msg)
              }
            }
          })
      }
    },
    components: {
      'mt-popup': Popup
    }
  }
</script>
<style lang="scss">
  .prompting-layer {
    width: 325px;
    text-align: center;
    padding: 23px 0 10px;
    border-radius: 5px;
    .close {
      position: absolute;
      background: url("../assets/img/close_icon1.png") center / contain no-repeat;
      width: 15px;
      height: 15px;
      right: 15px;
      top: 15px;
    }
    .promptingTop {
      padding: 0 17px;
      img {
        width: 61px;
        height: 61px;
        margin-bottom: 16px;
      }
      p {
        font-size: 16px;
        color: #333;
        margin-bottom: 20px;
        span {
          color: #1968b1;
        }
      }
      a {
        display: block;
        width: 100%;
        height: 40px;
        border-radius: 40px;
        border: solid 1px #1968b1;
        font-size: 16px;
        line-height: 40px;
        margin-bottom: 25px;
      }
      .btn_left {
        background: #1968b1;
        color: #fff;
      }
      .btn_right {
        color: #1968b1;
      }
    }
    .promptingBottom {
      padding-top: 10px;
      border-top: 1px solid #dddddd;
      a {
        font-size: 12px;
        color: #9f9f9f;
      }
    }
    .promptingBottom1 {
      width: 310px;
      padding: 0 17px;
      .title {
        position: relative;
        color: #a1a1a1;
        font-size: 12px;
        margin-bottom: 23px;
        &:before,&:after {
          position: absolute;
          height: 1px;
          content: '';
          top: 12px;
          background: #ddd;
          width: 60px;
        }
        &:before {
          left: 0;
        }
        &:after {
          right: 0;
        }
      }
      input {
        width: 100%;
        height: 40px;
        border-radius: 40px;
        border: solid 1px #dddddd;
        text-indent: 15px;
        color: #666;
      }
      .promptingBtn {
        font-size: 16px;
        color: #1968b1;
        margin-top: 18px;
      }
      .promptingA {
        margin-top: 14px;
        a {
          font-size: 12px;
          color: #9f9f9f;
        }
      }
    }
  }
</style>
